package com.andnnl.sleep;

import java.util.concurrent.TimeUnit;

/**
 * Created by chenss on 2020/10/9.
 */
public class SleepTest {
    public static void main(String[] args) {
        int n=0;
        long t1=System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
            try {
                TimeUnit.NANOSECONDS.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        long t2=System.currentTimeMillis();
        System.out.println(t2-t1);
    }
}
